﻿<phoneNavigation:PhoneApplicationPage 
    x:Class="RssReader.FeedItemDetailsPage"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phoneNavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"  
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  xmlns:mpc="clr-namespace:RssReader"        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="728"     d:DataContext="{d:DesignData SampleData/FeedItemViewModelSampleData.xaml}"    BackKeyPress="PhoneApplicationPage_BackKeyPress"     FontFamily="{StaticResource PhoneFontFamilyNormal}"    FontSize="{StaticResource PhoneFontSizeNormal}"    Foreground="{StaticResource PhoneForegroundBrush}" xmlns:browser="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone">
    <phoneNavigation:PhoneApplicationPage.Resources>
        <Storyboard x:Name="PageTransitionDetails">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TitleGrid" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="90">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TitleGrid" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="90">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ContentGrid" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)">
                <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </phoneNavigation:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <Grid x:Name="TitleGrid" Grid.Row="0">
            <Grid.Projection>
                <PlaneProjection/>
            </Grid.Projection>
            <Image Source="/rss.png"
                   Height="40" HorizontalAlignment="Right"
                   VerticalAlignment="Top"
                   Margin="8"
                   Opacity="0.7"/>
            <TextBlock Text="RSS READER" Style="{StaticResource PhoneTextPageTitle1Style}"/>
            <TextBlock Text="{Binding FeedName}"
                       Style="{StaticResource PhoneTextPageTitle2Style}"/>
        </Grid>
        
        <Grid x:Name="ContentGrid" Grid.Row="1">
            <Grid.Projection>
                <PlaneProjection/>
            </Grid.Projection>
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <TextBlock Text="{Binding CurrentFeedItem.Title}" TextWrapping="Wrap"
                       Grid.Row="0" Style="{StaticResource PhoneTextLargeStyle}"
                       Margin="10,0,0,0"/>
           
            <phoneNavigation:WebBrowser x:Name="browser"
                                        Grid.Row="1"/>            
           
        </Grid>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <phoneNavigation:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/back.png"
                                            x:Name="previousButton"
                                            Text="Previous"
                                            Click="Previous_Click"/>
            <shell:ApplicationBarIconButton IconUri="/forward.png"
                                            x:Name="nextButton"
                                            Text="Next"
                                            Click="Next_Click"/>
            <shell:ApplicationBarIconButton IconUri="/favourite.png"
                                            Text="Favourite"
                                            Click="Favourite_Click"/>    
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Click="SendAsSMS_Click"
                                              Text="Send as SMS"/>
            </shell:ApplicationBar.MenuItems>           
        </shell:ApplicationBar>
    </phoneNavigation:PhoneApplicationPage.ApplicationBar>

</phoneNavigation:PhoneApplicationPage>